package tr.edu.ege.kipler.test;

import java.io.BufferedReader;
import java.io.FileNotFoundException;
import java.io.FileReader;
import java.io.IOException;
import java.util.Set;

import tr.edu.ege.kipler.parsing.Parser;
import tr.edu.ege.kipler.syntax.WorldElement;

public class FormulaFileReader {
	public static Set<WorldElement> getFormulas(String qualifiedFileName) {
		StringBuilder builder = null;
		try {
			BufferedReader reader = new BufferedReader(new FileReader(
					qualifiedFileName));
			String line;
			builder = new StringBuilder();
			while ((line = reader.readLine()) != null) {
				builder.append(line + "\n");
			}
		} catch (FileNotFoundException e) {
			e.printStackTrace();
		} catch (IOException e) {
			e.printStackTrace();
		}
		return Parser.parseFormulaSet(builder.toString());
	}
}
